package com.css.fxfzypg.modules.auxiliaryDecisionManage.paramSetting.service.impl;

import com.css.fxfzypg.modules.auxiliaryDecisionManage.paramSetting.entity.ParamSetting;
import com.css.fxfzypg.modules.auxiliaryDecisionManage.paramSetting.entity.ParamSettingVO;
import com.css.fxfzypg.modules.auxiliaryDecisionManage.paramSetting.repository.ParamSettingRepository;
import com.css.fxfzypg.modules.auxiliaryDecisionManage.paramSetting.service.ParamSettingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: zhangSongRui
 * @CreateTime: 2023/03/22
 * @Description: 设置参数service
 */
@Service
public class ParamSettingServiceImpl implements ParamSettingService {

    @Resource
    private ParamSettingRepository paramSettingRepository;

    @Override
    public void save(ParamSetting paramSetting) {
        //清空表
        paramSettingRepository.delete();
        paramSetting.setId("1");
        //判断百分比
        paramSettingRepository.save(paramSetting);
    }

    @Override
    public ParamSettingVO getParamSetting() {
        return paramSettingRepository.getParamSetting();
    }
}
